﻿using System;

namespace ESoft.Helpers
{
    public class PasswordHelper
    {
        public static String EncryptPassword(String oldPass, string salt)
        {
            return EncryptHelper.Md5Encode(oldPass + salt, 32);
        }

        public static bool ValidatePassword(String newpassword, string salt, String dbPassword)
        {
            return EncryptPassword(newpassword, salt).Equals(dbPassword, StringComparison.CurrentCultureIgnoreCase);
        }
    }
}
